package com.example.ross.utils;

import com.example.ross.model.ResultFormatPaging;

/**
 * 分页工具
 * @author RossZhang
 * @version 1.0
 * @date 2020/7/16
 */
public class ResultPagingUtil {

    /**
     *分页返回数据格式 ----成功
     * @param code
     * @param count
     * @param obj
     * @return
     */
    public static ResultFormatPaging pagingSuccess(Integer code,Long count,Object obj){
        ResultFormatPaging result = new ResultFormatPaging();
        result.setCode(code);
        result.setCount(count);
        result.setData(obj);
        return result;
    }

    /**
     * 分页返回数据格式
     * 错误
     *
     * @param object
     * @return
     */
    public static ResultFormatPaging pagingError(Integer code, Long count, Object object) {
        ResultFormatPaging result = new ResultFormatPaging();
        result.setCode(code);
        result.setCount(count);
        result.setData(object);
        return result;
    }
}
